<?php
// echo 'this file will ...';
// var_dump($_POST);
echo "<pre>";
print_r($_POST);
echo "</pre>";
// echo $_GET['stuname'];
// var_dump($_REQUEST);

// // 写入数据
// $handle = fopen("file.csv", "a");
// $content = $_POST['stuname'] . ',' . $_POST['stunumber'] . ',' . $_POST['stuurl'] . "\n";
// fwrite($handle, $content);
// fclose($handle);

// // 显示数据
// include 'view.php';


// 将接收到的数据存入到数据库

$dbc = mysqli_connect ('localhost', 'root', 'root', 'stuinfo');

mysqli_set_charset($dbc, 'utf8mb4');

$query = "INSERT INTO `stuinfo`.`info` (`name`, `class`, `no`, `giturl`) VALUES ('" . $_POST['stuname'] . "','" . $_POST['class1'] . "','" . $_POST['stunumber'] ."','" . $_POST['stuurl']."')";

// $query = "INSERT INTO site (sitetype,siteurl,siteinfo) VALUES('" . $_POST['网站类别'] ."','" . $_POST['网址'] . "','" . $_POST['简介'] ."')";

$r = mysqli_query($dbc, $query);

echo '<pre>';
var_dump($r,$query);
echo '</pre>';